#!/usr/bin/ksh

findit ()
{
echo "Enter directory where object will search"
read _DIR1
if [ -d $_DIR1 ] 
then
echo "Directory where find is $_DIR1"
echo "Enter object for search"
read _FOO 
echo "Objects which were finded"
find $_DIR1 -name ${_FOO}*
 if [ $? != 0 ] 
 then
 continue
 fi
else
echo "$_DIR1 is not directory try again"
fi
}
while true 
do
echo "If you want to search item enter \"f\" "
echo "If you want exit enter \"q\" "
read ANS
case $ANS in
f|F) findit 2>/dev/null
;;
q|Q) exit 1
;;
*) echo "enter correct value"
;;
esac
if [ $? = 1 ]
then
return
fi
done
